
/*
 * Filename: /home/long/work/sample/c/2020-f0803/t3.c
 * Path: /home/long/work/sample/c/2020-f0803
 * Created Date: Tuesday, March 23rd 2021, 8:20:44 pm
 * Author: long
 * 
 * Copyright (c) 2021 Your Company
 */


#include <stdio.h>
#include <string.h>

int fabn(int *fns, int n)
{
    if (n < 0) {
        printf("error num\n");
        return 0;
    }else if (n<=2) {
        fns[n] = n;
        return n;
    }
    if(fns[n] == 0){
        fns[n] = fabn(fns, n-1) + fabn(fns, n-2);
    }
    return fns[n];
}

int main()
{
    int n;
    int cn;
    int *fns;
    scanf("%d", &n);
    fns = malloc(sizeof(int)*(n+1));
    memset(fns, 0, sizeof(int)*(n+1));
    // need check fns
    float r = 0;
    for(int i=1; i<=n; i++) {
        cn = fabn(fns, i);
        r += 1.0/cn;
        if (i < 5 && i != n)
            printf("1/%d+", cn);
        else if(i==n){
            if (i > 5)
                printf("...+");
            printf("1/%d=%.2f\n", cn, r);
        }
    }
}